package com.xy.iot.common.result;

import java.io.Serializable;
import java.util.Objects;

public class DeviceData implements Serializable {
        /**
         * 设备组编码
         */
        private String deviceGroup;

        /**
         * 设备号
         */
        private int device;

        public DeviceData(String deviceGroup, int device){
            this.deviceGroup = deviceGroup;
            this.device = device;
        }

        public String deviceGroup(){
            return deviceGroup;
        }

        public int device(){
            return device;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }

            DeviceData that = (DeviceData) o;

            if (device != that.device) {
                return false;
            }
            return Objects.equals(deviceGroup, that.deviceGroup);
        }

        @Override
        public int hashCode() {
            int result = deviceGroup != null ? deviceGroup.hashCode() : 0;
            result = 31 * result + device;
            return result;
        }
}
